<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen; http://apigen.org" />

	<title>Class Nette\Web\Session</title>

	<link rel="stylesheet" href="resources/style.css?v=2011071314" type="text/css" media="all" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link rel="search" href="opensearch.xml" type="application/opensearchdescription+xml" title="Nette Framework API documentation" />
	<script type="text/javascript" src="resources/combined.js"></script>
	<script type="text/javascript" src="allclasses.js"></script>
</head>

<body>
<div id="left">
	<a href="allclasses.html">All Classes</a>

	<h3>Namespaces</h3>
	<ul>
		<li><a href="namespace-none.html">none</a>
		</li>
		<li><a href="namespace-Nette.html">Nette</a>
		</li>
		<li><a href="namespace-Nette.Application.html">Nette\Application</a>
		</li>
		<li><a href="namespace-Nette.Caching.html">Nette\Caching</a>
		</li>
		<li><a href="namespace-Nette.Collections.html">Nette\Collections</a>
		</li>
		<li><a href="namespace-Nette.Config.html">Nette\Config</a>
		</li>
		<li><a href="namespace-Nette.Forms.html">Nette\Forms</a>
		</li>
		<li><a href="namespace-Nette.IO.html">Nette\IO</a>
		</li>
		<li><a href="namespace-Nette.Loaders.html">Nette\Loaders</a>
		</li>
		<li><a href="namespace-Nette.Mail.html">Nette\Mail</a>
		</li>
		<li><a href="namespace-Nette.Reflection.html">Nette\Reflection</a>
		</li>
		<li><a href="namespace-Nette.Security.html">Nette\Security</a>
		</li>
		<li><a href="namespace-Nette.Templates.html">Nette\Templates</a>
		</li>
		<li class="active"><a href="namespace-Nette.Web.html">Nette\Web</a>
		</li>
		<li><a href="namespace-PHP.html">PHP</a>
		</li>
	</ul>

	<hr />

	<h3>Classes</h3>

	<ul>
		<li><a href="Nette.Web.Ftp.html">Ftp</a></li>
		<li><a href="Nette.Web.Html.html">Html</a></li>
		<li><a href="Nette.Web.HttpContext.html">HttpContext</a></li>
		<li><a href="Nette.Web.HttpRequest.html">HttpRequest</a></li>
		<li><a href="Nette.Web.HttpResponse.html">HttpResponse</a></li>
		<li><a href="Nette.Web.HttpUploadedFile.html">HttpUploadedFile</a></li>
		<li class="active"><a href="Nette.Web.Session.html">Session</a></li>
		<li><a href="Nette.Web.SessionNamespace.html">SessionNamespace</a></li>
		<li><a href="Nette.Web.Uri.html">Uri</a></li>
		<li><a href="Nette.Web.UriScript.html">UriScript</a></li>
		<li><a href="Nette.Web.User.html">User</a></li>
	</ul>

	<h3>Interfaces</h3>

	<ul>
		<li><a href="Nette.Web.IHttpRequest.html">IHttpRequest</a></li>
		<li><a href="Nette.Web.IHttpResponse.html">IHttpResponse</a></li>
		<li><a href="Nette.Web.IUser.html">IUser</a></li>
	</ul>

	<h3>Exceptions</h3>

	<ul>
		<li><a href="Nette.Web.FtpException.html">FtpException</a></li>
	</ul>
</div>

<div id="right">
	<form action="http://www.google.com/cse" id="search" onsubmit="if(this.q.value.indexOf('more:')==-1)this.q.value+=' more:api'">
		<input type="hidden" name="cx" value="011549293477758430224:vxofa9ufnhc" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" class="text" /><input type="submit" value="Search" />
	</form>

<div id="navigation">
	<ul>
		<li><a href="overview.html" title="Summary of all namespaces">Overview</a></li>
		<li><a href="namespace-Nette.Web.html" title="Summary of Nette\Web">Namespace</a></li>
		<li class="active">Class</li>
		<li><a href="elements.html">Elements</a></li>
	</ul>
</div>

<div id="content">
	<div id="classSummary">
		<p>namespace <a href="namespace-Nette.Web.html">Nette\Web</a></p>

		<h1>Class Session</h1>

		<div class="classDescription">
		
<p>Provides access to session namespaces as well as session settings and
management methods.</p>

		</div>

		<dl class="tree">
			<dd style="padding-left:0px">
				<a href="Nette.Object.html">Nette\Object</a>
				
			</dd>
			<dd style="padding-left:30px">
				<img src="resources/inherit.gif" alt="extended by" />
<b>Nette\Web\Session</b>				
			</dd>
		</dl>



		<div class="classInfo">
			
				<b>Author:</b> David Grudl<br />
			<b>Located at</b> <a href="source-Web.Session.php.html#18">/Web/Session.php</a><br />
		</div>
	</div>


	<div id="methodSummary">
		<table class="summary">
		<caption>Method Summary</caption>
		<tr data-order="1 start" id="_start">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_start">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#62" title="go to source code"><b>start</b></a>(
			)</code>

			<div class="short">
				
<p>Starts and initializes session data.</p>

			</div>

			<div class="detailed">
				
<p>Starts and initializes session data.</p>





					<h4>Throws</h4>
					<div class="smallList">
						<a href="InvalidStateException.html">InvalidStateException</a> <br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="1 isStarted" id="_isStarted">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				bool
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_isStarted">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#150" title="go to source code"><b>isStarted</b></a>(
			)</code>

			<div class="short">
				
<p>Has been session started?</p>

			</div>

			<div class="detailed">
				
<p>Has been session started?</p>




					<h4>Returns</h4>
					<div class="smallList">bool </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 close" id="_close">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_close">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#161" title="go to source code"><b>close</b></a>(
			)</code>

			<div class="short">
				
<p>Ends the current session and store session data.</p>

			</div>

			<div class="detailed">
				
<p>Ends the current session and store session data.</p>






			</div>
			</td>
		</tr>
		<tr data-order="1 destroy" id="_destroy">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_destroy">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#176" title="go to source code"><b>destroy</b></a>(
			)</code>

			<div class="short">
				
<p>Destroys all data registered to a session.</p>

			</div>

			<div class="detailed">
				
<p>Destroys all data registered to a session.</p>






			</div>
			</td>
		</tr>
		<tr data-order="1 exists" id="_exists">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				bool
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_exists">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#197" title="go to source code"><b>exists</b></a>(
			)</code>

			<div class="short">
				
<p>Does session exists for the current request?</p>

			</div>

			<div class="detailed">
				
<p>Does session exists for the current request?</p>




					<h4>Returns</h4>
					<div class="smallList">bool </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 regenerateId" id="_regenerateId">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_regenerateId">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#208" title="go to source code"><b>regenerateId</b></a>(
			)</code>

			<div class="short">
				
<p>Regenerates the session ID.</p>

			</div>

			<div class="detailed">
				
<p>Regenerates the session ID.</p>





					<h4>Throws</h4>
					<div class="smallList">
						<a href="InvalidStateException.html">InvalidStateException</a> <br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="1 getId" id="_getId">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getId">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#228" title="go to source code"><b>getId</b></a>(
			)</code>

			<div class="short">
				
<p>Returns the current session ID. Don't make dependencies, can be changed for
each request.</p>

			</div>

			<div class="detailed">
				
<p>Returns the current session ID. Don't make dependencies, can be changed for
each request.</p>




					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 setName" id="_setName">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Web.Session.html">Session</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_setName">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#239" title="go to source code"><b>setName</b></a>(
					string
					<var>$name</var>
			)</code>

			<div class="short">
				
<p>Sets the session name to a specified one.</p>

			</div>

			<div class="detailed">
				
<p>Sets the session name to a specified one.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.Session.html">Session</a> provides a fluent interface</div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getName" id="_getName">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				string
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getName">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#258" title="go to source code"><b>getName</b></a>(
			)</code>

			<div class="short">
				
<p>Gets the session name.</p>

			</div>

			<div class="detailed">
				
<p>Gets the session name.</p>




					<h4>Returns</h4>
					<div class="smallList">string </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getNamespace" id="_getNamespace">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Web.SessionNamespace.html">SessionNamespace</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getNamespace">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#273" title="go to source code"><b>getNamespace</b></a>(
					string
					<var>$namespace</var>, 
					string
					<var>$class</var> = <span class="php-quote">'Nette\\Web\\SessionNamespace'</span>
			)</code>

			<div class="short">
				
<p>Returns specified session namespace.</p>

			</div>

			<div class="detailed">
				
<p>Returns specified session namespace.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$namespace</code> string <br />
						<code>$class</code> string <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.SessionNamespace.html">SessionNamespace</a> </div>

					<h4>Throws</h4>
					<div class="smallList">
						<a href="InvalidArgumentException.html">InvalidArgumentException</a> <br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="1 hasNamespace" id="_hasNamespace">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				bool
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_hasNamespace">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#295" title="go to source code"><b>hasNamespace</b></a>(
					string
					<var>$namespace</var>
			)</code>

			<div class="short">
				
<p>Checks if a session namespace exist and is not empty.</p>

			</div>

			<div class="detailed">
				
<p>Checks if a session namespace exist and is not empty.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$namespace</code> string <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">bool </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getIterator" id="_getIterator">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="ArrayIterator.html">ArrayIterator</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getIterator">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#311" title="go to source code"><b>getIterator</b></a>(
			)</code>

			<div class="short">
				
<p>Iteration over all namespaces.</p>

			</div>

			<div class="detailed">
				
<p>Iteration over all namespaces.</p>




					<h4>Returns</h4>
					<div class="smallList"><a href="ArrayIterator.html">ArrayIterator</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 clean" id="_clean">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_clean">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#331" title="go to source code"><b>clean</b></a>(
			)</code>

			<div class="short">
				
<p>Cleans and minimizes meta structures.</p>

			</div>

			<div class="detailed">
				
<p>Cleans and minimizes meta structures.</p>






			</div>
			</td>
		</tr>
		<tr data-order="1 setOptions" id="_setOptions">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Web.Session.html">Session</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_setOptions">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#369" title="go to source code"><b>setOptions</b></a>(
					array
					
					<var>$options</var>
			)</code>

			<div class="short">
				
<p>Sets session options.</p>

			</div>

			<div class="detailed">
				
<p>Sets session options.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$options</code> array <br />
					</div>

					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.Session.html">Session</a> provides a fluent interface</div>

					<h4>Throws</h4>
					<div class="smallList">
						<a href="NotSupportedException.html">NotSupportedException</a> <br />
						<a href="InvalidStateException.html">InvalidStateException</a> <br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="1 getOptions" id="_getOptions">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				array
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getOptions">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#390" title="go to source code"><b>getOptions</b></a>(
			)</code>

			<div class="short">
				
<p>Returns all session options.</p>

			</div>

			<div class="detailed">
				
<p>Returns all session options.</p>




					<h4>Returns</h4>
					<div class="smallList">array </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 setExpiration" id="_setExpiration">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Web.Session.html">Session</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_setExpiration">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#451" title="go to source code"><b>setExpiration</b></a>(
					string|int|<a href="DateTime.html">DateTime</a>
					<var>$time</var>
			)</code>

			<div class="short">
				
<p>Sets the amount of time allowed between requests before the session will be
terminated.</p>

			</div>

			<div class="detailed">
				
<p>Sets the amount of time allowed between requests before the session will be
terminated.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$time</code> string|int|<a href="DateTime.html">DateTime</a> time, value 0 means „until the browser is closed“<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.Session.html">Session</a> provides a fluent interface</div>


			</div>
			</td>
		</tr>
		<tr data-order="1 setCookieParams" id="_setCookieParams">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Web.Session.html">Session</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_setCookieParams">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#475" title="go to source code"><b>setCookieParams</b></a>(
					string
					<var>$path</var>, 
					string
					<var>$domain</var> = <span class="php-keyword1">NULL</span>, 
					bool
					<var>$secure</var> = <span class="php-keyword1">NULL</span>
			)</code>

			<div class="short">
				
<p>Sets the session cookie parameters.</p>

			</div>

			<div class="detailed">
				
<p>Sets the session cookie parameters.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$path</code> string path<br />
						<code>$domain</code> string domain<br />
						<code>$secure</code> bool secure<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.Session.html">Session</a> provides a fluent interface</div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getCookieParams" id="_getCookieParams">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				array
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getCookieParams">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#493" title="go to source code"><b>getCookieParams</b></a>(
			)</code>

			<div class="short">
				
<p>Returns the session cookie parameters.</p>

			</div>

			<div class="detailed">
				
<p>Returns the session cookie parameters.</p>




					<h4>Returns</h4>
					<div class="smallList">array containing items: lifetime, path, domain, secure, httponly</div>


			</div>
			</td>
		</tr>
		<tr data-order="1 setSavePath" id="_setSavePath">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				<a href="Nette.Web.Session.html">Session</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_setSavePath">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#504" title="go to source code"><b>setSavePath</b></a>(
					
					<var>$path</var>
			)</code>

			<div class="short">
				
<p>Sets path of the directory used to save session data.</p>

			</div>

			<div class="detailed">
				
<p>Sets path of the directory used to save session data.</p>




					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.Session.html">Session</a> provides a fluent interface</div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getHttpRequest" id="_getHttpRequest">
			<td align="right" width="1%"><code class="nowrap">
				 protected 
				<a href="Nette.Web.IHttpRequest.html">IHttpRequest</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getHttpRequest">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#534" title="go to source code"><b>getHttpRequest</b></a>(
			)</code>

			<div class="short">
				
			</div>

			<div class="detailed">
				



					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.IHttpRequest.html">IHttpRequest</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 getHttpResponse" id="_getHttpResponse">
			<td align="right" width="1%"><code class="nowrap">
				 protected 
				<a href="Nette.Web.IHttpResponse.html">IHttpResponse</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getHttpResponse">#</a>
			<code class="nowrap">
				<a href="source-Web.Session.php.html#544" title="go to source code"><b>getHttpResponse</b></a>(
			)</code>

			<div class="short">
				
			</div>

			<div class="detailed">
				



					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Web.IHttpResponse.html">IHttpResponse</a> </div>


			</div>
			</td>
		</tr>

		</table>
	</div>


	<h2>Methods Inherited From <a href="Nette.Object.html#methodSummary">Nette\Object</a></h2>
	<div class="box"><code>
		<a href="Nette.Object.html#_getClass" class="deprecated">getClass()</a>, <a href="Nette.Object.html#_getReflection">getReflection()</a>, <a href="Nette.Object.html#___call">__call()</a>, <a href="Nette.Object.html#___callStatic">__callStatic()</a>, <a href="Nette.Object.html#_extensionMethod">extensionMethod()</a>, <a href="Nette.Object.html#___get">__get()</a>, <a href="Nette.Object.html#___set">__set()</a>, <a href="Nette.Object.html#___isset">__isset()</a>, <a href="Nette.Object.html#___unset">__unset()</a>
	</code></div>


	<div id="constantSummary">
		<table class="summary">
		<caption>Constant Summary</caption>
		<tr data-order="DEFAULT_FILE_LIFETIME" id="DEFAULT_FILE_LIFETIME">
			<td align="right" width="1%"><code><b>DEFAULT_FILE_LIFETIME</b></code></td>
			<td><code><span class="php-num">10800</span></code> <a href="#DEFAULT_FILE_LIFETIME" class="anchor">#</a></td>
		</tr>
		</table>
	</div>



	<div id="propertySummary">
		<table class="summary">
		<caption>Property Summary</caption>
		<tr data-order="verificationKeyGenerator" id="$verificationKeyGenerator" class="deprecated">
			<td align="right" width="1%"><code class="nowrap">
				deprecated  
				
			</code></td>

			<td width="1%"><var>$verificationKeyGenerator</var></td>
			<td><pre><span class="php-keyword1">NULL</span></pre></td>
			<td> <a href="#$verificationKeyGenerator" class="anchor">#</a></td>
		</tr>

		</table>
	</div>


</div>

	<div id="footer">
		Nette Framework API documentation generated by <a href="http://apigen.org">ApiGen</a>
	</div>
</div>
</body>
</html>
